<?php
session_start();
require '../conf/config.php';
include('../controller/maincontroller.php');
		conndb::getInst()->query("SELECT DISTINCT a.id FROM sutazna_kategoria a INNER JOIN sutazne_kolo b on (b.id_sutazna_kategoria=a.id) WHERE b.id_sutaz=".$_SESSION['idupravsu']." "); 
		$zleid = conndb::getInst()->getRowsAsArrayOfObjects();	
		$where='';
		foreach($zleid as $zle){
			$where="".$where."id!='".$zle->id."' AND ";
		}
		conndb::getInst()->query("SELECT Meno FROM sutazna_kategoria WHERE ".$where." 1=1");
		$data = conndb::getInst()->getRowsAsArrayOfObjects();	
		$pole=array();
		$pole['Meno']=array();
		foreach ($data as $d){
			array_push($pole['Meno'],$d->Meno);
		}
		echo json_encode($pole);
		exit;
?>